/**
 * 版权所有 (C), 2019-2019, XXX有限公司
 * 项目名：com.company.study.designpatterns.prototype.register
 * 文件名: ConcretePrototype1
 * 日期: 2019/6/15 14:07
 * 说明:
 */
package com.company.study.designpatterns.prototype.register;

/**
 * 具体原型角色1
 *
 * @author Anbang713
 * @create 2019/6/15
 */
public class ConcretePrototype1 implements Prototype {
    
    private String name;

    public Prototype clone() {
        ConcretePrototype1 prototype = new ConcretePrototype1();
        prototype.setName(this.name);
        return prototype;
    }

    public String toString() {
        return "Now in Prototype1 , name = " + this.name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }
}